
package com.alex.insistence.rest.banner;

import com.alex.insistence.web.cgform.banner.entity.BannerItemEntity;
import com.gomore.jeecg.converter.Converter;

/**
 * @author:liyang
 * @time:2017年7月31日 下午7:45:11
 * @since:1.0
 */
public class BannerItemConverter implements Converter<BannerItemEntity, RsBannerItem> {

  private static BannerItemConverter instance;

  public static synchronized BannerItemConverter getInstance() {
    if (instance == null) {
      instance = new BannerItemConverter();
    }
    return instance;
  }

  @Override
  public RsBannerItem convert(BannerItemEntity source) {
    if (source == null) {
      return null;
    } else {
      return convert(source, new RsBannerItem());
    }
  }

  @Override
  public RsBannerItem convert(BannerItemEntity source, RsBannerItem dest) {

    dest = new RsBannerItem();
    dest.setBannerId(source.getBannerId());
    dest.setImageUrl(source.getImageUrl());
    dest.setRedirectUrl(source.getRedirectUrl());
    dest.setRemark(source.getRemark());
    return dest;
  }

}
